package edu.zju.udms.dnavigator.core.entity;

import java.io.Serializable;
import java.util.UUID;

public class MetaObject implements Serializable{
	
	private static final long serialVersionUID = 3009769772111305184L;
	
	//internal field mapping to fields of lucene document which start with underline
	@AttributeType(AttributeTypeEnum.Internal)
	private String id;
	
	@AttributeType(AttributeTypeEnum.Internal)
	private long version;
	
	@AttributeType(AttributeTypeEnum.Internal)
	private String classname;

	public MetaObject(){
		id = UUID.randomUUID().toString();
		version = System.currentTimeMillis();
		classname = this.getClass().getCanonicalName();
	}
	
	public MetaObject(String id,long version,String classname){
		this.id = id;
		this.version = version;
		this.classname = classname;
	}

	public String getId() {
		return id;
	}

	void setId(String id) {
		this.id = id;
	}

	public long getVersion() {
		return version;
	}

	void setVersion(long version) {
		this.version = version;
	}

	public String getClassname() {
		return classname;
	}

	void setClassname(String classname) {
		this.classname = classname;
	}
	
}
